<?php
/**
 * @package Autogenerator for Joomla!
 * @version 3.0.0
 * @author Truong Cong Duc <truongcongduc4@gmail.com>
 * @link autogenerator.blogspot.com
 * @copyright (c) 2013, Truong Cong Duc
 * @license GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

define('AUTOGENERATOR_DIR_ROOT', __DIR__);

define('AUTOGENERATOR_DIR_CODE_TEMPLATE', __DIR__ . DIRECTORY_SEPARATOR . 'helpers'. DIRECTORY_SEPARATOR . 'code_template' . DIRECTORY_SEPARATOR);

define('AUTOGENERATOR_URL_CSS', 'administrator/components/com_autogenerator/theme/css/');
define('AUTOGENERATOR_URL_JS', 'administrator/components/com_autogenerator/theme/js/');

if (!JFactory::getUser()->authorise('core.manage', 'com_autogenerator'))
{
	return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
}

JLoader::register('AutogeneratorHelper', __DIR__ . '/helpers/autogenerator.php');

$oController = JControllerLegacy::getInstance('Autogenerator');

$oController->execute(JFactory::getApplication()->input->get('task'));

$oController->redirect();
